<html><head><title>CreatePreferences</title></head>
<body bgcolor="#EFF1F0" link="#3A3966" vlink="#000000" alink="#000000">
<font face="Verdana, sans-serif" size="2"><p align="center"><b><font size="4">CreatePreferences()</font></b></p>
<p><b>Syntax</b></p><blockquote>
Result = <font color="#3A3966"><b>CreatePreferences</b></font>(Filename$ [, Flags])</blockquote>

</blockquote>
<b>Description</b><br><blockquote>

Creates a new empty preference file. If the file already exists, the file is erased. 

</blockquote><p><b>Parameters</b></p><blockquote>
<style type="text/css">
table.parameters { border-spacing: 0px; border-style: none; border-collapse: collapse; }
table.parameters td { border-width: 1px; padding: 6px; border-style: solid; border-color: gray; vertical-align: top; font-family:Arial; font-size:10pt; }
</style>
<table width="90%" class="parameters">
<tr><td width="10%"><i>Filename$</i></td>
<td width="90%"> 
The filename of the new preference file. 

</td></tr>
<tr><td><i>Flags (optional)</i></td>
<td> 
It can be a combination of the following values: 
<pre><font face="Courier New, Courier, mono"size="2">  <font color="#924B72">#PB_Preference_NoSpace</font>: no spaces will be put around the equal sign joining key and values.
                          It can be useful when dealing with external preferences files which doesn't
                          accept spaces around equal sign.
  <font color="#924B72">#PB_Preference_GroupSeparator</font>: add an empty line between the groups to ease readability of the file.
</font></pre>

</td></tr>
</table>
</blockquote><p><b>Return value</b></p><blockquote>

Nonzero if the file has been successfully created, zero otherwise. 

</blockquote><p><b>Remarks</b></p><blockquote>

Once created, the functions like <a href="writepreferencestring.html">WritePreferenceString()</a> can be used to write data. When values are written in preferences, 
it's possible to read them back with the functions like <a href="readpreferencestring.html">ReadPreferenceString()</a>. 
<br>
<br>
To remove a key or a group, use <a href="removepreferencekey.html">RemovePreferenceKey()</a> and <a href="removepreferencegroup.html">RemovePreferenceGroup()</a>. 
To create or change the current group, use <a href="preferencegroup.html">PreferenceGroup()</a>. 
<br>
<br>
Once all write operations are done, <a href="closepreferences.html">ClosePreferences()</a> needs to be called to really write the preferences back to disk. 

</blockquote><p><b>Example</b></p><blockquote>

<pre><font face="Courier New, Courier, mono"size="2">  <font color="#3A3966">; Create a preference file nammed Setup.ini</font>
<font color="#3A3966">  CreatePreferences</font>(<font color="#3A3966">GetTemporaryDirectory</font>()+&quot;Setup.ini&quot;)
  
  <font color="#3A3966">; Create a group named &quot;Window&quot;</font>
<font color="#3A3966">  PreferenceGroup</font>(&quot;Window&quot;)
<font color="#3A3966">    WritePreferenceLong </font>(&quot;X&quot;, 10)     <font color="#3A3966">; X = 10</font>
<font color="#3A3966">    WritePreferenceLong </font>(&quot;Y&quot;, 10)     <font color="#3A3966">; Y = 10</font>
<font color="#3A3966">    WritePreferenceLong</font>(&quot;W&quot;, 800)     <font color="#3A3966">; W = 800</font>
<font color="#3A3966">    WritePreferenceLong</font>(&quot;H&quot;, 600)     <font color="#3A3966">; H = 600</font>
<font color="#3A3966">    WritePreferenceFloat</font>(&quot;%&quot;, 20)     <font color="#3A3966">; % = 20.000000</font>
<font color="#3A3966">    WritePreferenceString</font>(&quot;Title&quot;, &quot;PureNote&quot;) <font color="#3A3966">; Title = &quot;PureNote&quot;</font>
  
  <font color="#3A3966">; Close the preference file</font>
<font color="#3A3966">  ClosePreferences</font>()
</font></pre>

</blockquote><p><b>See Also</b></p><blockquote>

<a href="closepreferences.html">ClosePreferences()</a> 

</Blockquote><p><b>Supported OS </b><Blockquote>All</Blockquote></p><center><- <a href=closepreferences.html>ClosePreferences()</a> - <a href="index.html">Preference Index</a> - <a href="examinepreferencegroups.html">ExaminePreferenceGroups()</a> -><br><br>

</body></html>